<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var chong = [1,1,1,2,2,3,4,5,6,3,4,2,4,1];
        // 定义函数存入数组
        function quchong (arr) {
            // 定义一个新数组存放去重后的数组
            var array = [];
            for (var i = 1 ; i < arr.length ; i++) {
                // 如果新数组中没有这个元素，则把这个元素放进去
                if (array.indexOf(arr[i]) === -1) {
                    array.push(arr[i]);
                }
            }
            return array;
        }
        console.log(quchong(chong));

        
    </script>
</head>
<body>
    16.  数组去重；

    ```js

    [1,1,1,2,2,3,4,5,6,3,4,2,4,1,] ---> [1,2,3,4,5,6]

    ```

</body>
</html>